#pragma once

#include "VariableBindingsList.h"

namespace SNMP 
{
	public ref class PduData
	{
	public:
		enum class PduType
		{
			Get,
			GetNext,
			Response,
			Set,
			GetBulk,
			Trap
		};

	internal:
		HSNMP_PDU m_hPdu;
		HSNMP_SESSION m_hSession;
		VariableBindingsList^ m_vblVbl;
		PduType m_pduType;
		smiINT32 m_intRequestId;
		smiINT m_intErrorStatus;
		smiINT m_intErrorIndex;

	public:
		property signed long RequestID
		{
			signed long get(void)
			{
				return this->m_intRequestId;
			}
		};

		property signed long ErrorStatus
		{
			signed long get(void)
			{
				return this->m_intErrorStatus;
			}
		};

		property signed long ErrorIndex
		{
			signed long get(void)
			{
				return this->m_intErrorIndex;
			}
		};

		property PduType Type
		{
			PduType get(void)
			{ 
				return this->m_pduType;
			}
		};

		property SNMP::VariableBindingsList^ VariableBindingsList
		{
			SNMP::VariableBindingsList^ get(void)
			{ 
				return this->m_vblVbl;
			}
		};

	public:
		void Clear(void);
		~PduData(void);

	internal:
		PduData(void);
		PduData(HSNMP_SESSION hSession, HSNMP_PDU hPdu);
		void CreatePduHandle(HSNMP_SESSION hSession, smiINT pduType, smiINT32 requestID, smiINT errorStatus, smiINT errorIndex, SNMP::VariableBindingsList^ varbindlist);
		void CreatePduHandle(HSNMP_SESSION hSession, smiINT pduType, smiINT32 requestID, smiINT errorStatus, smiINT errorIndex, HSNMP_VBL varbindlist);
		void GetPduData(void);
		PduType static GetPduType(int value);
		signed long static GetPduType(PduData::PduType value);
	};
}